// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import ElementUI from 'element-ui'
import router from './router'
import './assets/theme/index.css'
import axios from 'axios';
import VueRouter from 'vue-router'
import store from './store/store'

Vue.prototype.$http = axios;
axios.defaults.baseURL = "http://localhost:8999/api";
axios.defaults.timeout = 5000;
// axios.interceptors.request.use(config => {
//   console.log(config);
//   loadinginstace = Loading.service({fullscreen: true})
//   return config
// }, error => {
//   loadinginstace.close()
//   Message.error({
//     message: '加载超时'
//   })
//   return Promise.reject(error)
//
// })
// axios.interceptors.response.use(data => {
//   loadinginstace.close()
//   return data
// }, error => {
//   loadinginstace.close()
//   Message.error({
//     message: '服务端发生错误'
//   })
//   return Promise.reject(error)
// })
Vue.config.productionTip = false
Vue.use(ElementUI)
Vue.use(VueRouter)
export default axios

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: {App},
  template: '<App/>',
  store,
  render: h => h(App)
})
